package com.siwei.mes.service.erp.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.siwei.mes.common.query.PageQuery;
import com.siwei.mes.entity.erp.Rwdcontract;
import com.siwei.mes.mapper.erp.RwdcontractMapper;
import com.siwei.mes.service.erp.RwdcontractService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * (Rwdcontract)表服务实现类
 *
 * @author linzi
 * @since 2024-08-16 23:02:52
 */
@Service
public class RwdcontractServiceImpl implements RwdcontractService {
    @Resource
    private RwdcontractMapper rwdcontractMapper;


    @Override
    public PageInfo<Rwdcontract> getPage(PageQuery<Rwdcontract, Rwdcontract> query) {
        Rwdcontract searchParam = query.getParams();
        return PageHelper.startPage(query.getPageNum(), query.getPageSize())
                .doSelectPageInfo(() -> rwdcontractMapper.getList(searchParam));
    }

    @Override
    public List<Rwdcontract> getAll(Rwdcontract entity) {
        return rwdcontractMapper.getList(entity);
    }
}
